import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'

export const articleCategoryListService = ()=>{
    return request.get('/category')
}

export const articleCategoryAddService = (catagoryData)=>{
    return request.post('/category',catagoryData)
}

export const articleCategoryUpdateService = (catagoryData)=>{
    return request.put('/category',catagoryData)
}

export const articleCategoryDeleteService = (id)=>{
    return request.delete('/category?id='+id)
}

export const articleListService = (params)=>{
    return request.get('/article',{params:params})
}

export const articleAddService = (articleData)=>{
    return request.post('/article',articleData)
}

export const articleUpdateService = (articleData) =>{
    return request.put('/article',articleData)
}

export const articleDeleteService = (id)=>{
    return request.delete('/article?id='+id)
}